<h1>New task</h1>

<%= error_messages_for :task %>

<% form_for(@task) do |f| %>
  <p>
    <label for="project_id">Project</label><br />
    <%= f.collection_select :project_id, @task.associated_and_open_projects(current_user), :id, :title %>
  </p>

  <p>
    <label for="name">Name</label><br />
    <%= f.text_field :name %>
  </p>

  <p>
    <label for="estimated_effort">Estimated effort</label><br />
    <%= f.text_field :estimated_effort %>
  </p>

  <p>
    <label for="description">Description</label><br />
    <%= f.text_area :description, :rows => 5, :cols => 32 %>
  </p>

  <p>
    <label for="finished">Finished</label><br />
    <%= f.check_box :finished %>
  </p>

  <p>
    <%= f.submit "Create" %>
  </p>
<% end %>

<%= link_to 'Back', tasks_path %>
